package com.example.a623

import android.view.View
import android.view.ViewGroup
import androidx.viewpager.widget.PagerAdapter

class ViewPagerAdapter(list:ArrayList<View>):PagerAdapter() {
    var lists=list
    override fun getCount(): Int {
        return lists.size
    }

    override fun instantiateItem(container: ViewGroup, position: Int): Any {
        container.addView(lists.get(position))
        return lists.get(position)
    }

    override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
        container.removeView(lists.get(position))
    }

    override fun isViewFromObject(view: View, `object`: Any): Boolean {
        return view==`object`
    }
}